<extend name="Index:base" />
        <block name="b_content">
            <div id="content-header">
                <h1>资金托管</h1>
            </div>
            <div id="breadcrumb">
                <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a>
                <a href="#" class="current">资金托管</a>
            </div>
            <div class="container-fluid">
                <div class="row-fluid">
                    <div class="btn-group" role="group">
                        <a href="{:U('/Prom/Index/prjmoney@'. getDomain(), array('ltype'=>1))}" class="btn btn-default <eq name="ltype" value="1">btn-chosen</eq>">未托管</a>
                        <a href="{:U('/Prom/Index/prjmoney@'. getDomain(), array('ltype'=>5))}" class="btn btn-default <eq name="ltype" value="5">btn-chosen</eq>">部分托管</a>
                        <a href="{:U('/Prom/Index/prjmoney@'. getDomain(), array('ltype'=>2))}" class="btn btn-default <eq name="ltype" value="2">btn-chosen</eq>">已托管</a>
                    </div>
                    <div class="btn-group" role="group">
                        <form action="{:U('/Prom/Index/prjmoney@'. getDomain())}" method="post" onsubmit="return checkWord();">
                            <input id="searchword" name="searchword" type="text" value="" placeholder="{$kw|default='输入职位名称，支持模糊查询'}" /><button type="submit" class="btn btn-default"><i class="icon-search"></i>搜索</button>
                            <input type="hidden" name="ltype" value="{$ltype}" />
                        </form>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="span12">
                        <div class="widget-box">
                            <div class="widget-title">
                                <span class="icon">
                                    <input type="checkbox" id="title-checkbox" name="title-checkbox" />
                                </span>
                                <h5>职位列表</h5>
                            </div>
                            <div class="widget-content nopadding">
                                <table class="table table-bordered table-striped with-check">
                                    <thead>
                                        <tr>
                                            <th><i class="icon-resize-vertical"></i></th>
                                            <th>职位名称</th>
                                            <th>薪酬</th>
                                            <th>团队名称</th>
                                            <th>创始人</th>
                                            <th>发布时间</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <volist name="list" id="item" >
                                        <tr>
                                            <td><input type="checkbox" /></td>
                                            <td>{$item.jname}</td>
                                            <td>{$item.salary}</td>
                                            <td>{$item.tname}</a></td>
                                            <td>{$item.founder}</td>
                                            <td>{$item.jctime|toTime}</td>
                                            <td>
                                                <neq name="ltype" value="2">
                                                <a href="javascript:setDelegate({$item.uid},{$item.id|default=0}, 1);" class="btn nopadding">设置成已托管</a>
                                                <else />
                                                <a href="javascript:setDelegate({$item.uid},{$item.id|default=0}, -1);" class="btn nopadding">撤销已托管</a>
                                                </neq>
                                                <neq name="ltype" value="5">
                                                <a href="javascript:setDelegate({$item.uid},{$item.id|default=0}, 4);" class="btn nopadding">设置成部分托管</a>
                                                </neq>
                                                <a href="{:U('/Prom/Index/recom@'. getDomain(), array('oid'=>$item['id'],'stype'=>1))}" class="btn nopadding">推荐到首页</a>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <p>{$show}</p>
                </div>
            </div>
        </block>
<block name="b_footer_script">
    <div style="display: none;">
        <div id="sendbox" class="popbox-bg">
            <div class="title">发送消息</div>
            <div class="body">
                <p>内容</p>
                <textarea id="msg" placeholder="在这里输入消息内容……"></textarea>
                <p><a id='send' class="btn">发送</a><a id="cancel" class="btn pull-right">取消</a></p>
            </div>
        </div>
    </div>
    <script>
        $(document).ready(function(){
            $('#searchword').focus();
        });
        
        function setDelegate(uid, id, status){
            var url = "{:U('/Prom/Index/setDelegate@'. getDomain())}";
            $.post(url, {'uid':uid, 'id':id, 'status':status}, function(data){
                var vdata = eval(data);
                if(vdata.success==1){
                    alert(vdata.msg);
                    window.location.reload();
                }else{
                    alert(vdata.msg);
                }
            }, 'json');
        }
        
        function checkWord(){
            var kw = $('#searchword').val();
            if(kw==''){
                return false;
            }
            return true;
        }
    </script>
</block>